package com.woniuxy.shop.Entity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @ClassName Responseentity
 * @Description
 * @Author ll
 * @Date 2022/10/19 15:47
 * @Version 1.0
 **/
@Getter
@Setter
@NoArgsConstructor
public class ResponseEntity<T> {
    private String code;//响应码
    private  String msg;//描述信息
    private T data;//响应数据
    public  ResponseEntity(String code ,String msg){
        this(code,msg,null);
    }
    public  ResponseEntity(T data){
        this.data=data;
    }
    public  ResponseEntity(String code ,String msg,T data){
        this.code=code;
        this.data=data;
        this.msg=msg;
    }
    public static final ResponseEntity FAIL = new ResponseEntity("500" ,"失败");
    public static final ResponseEntity SUCCESS = new ResponseEntity("200" ,"OK");
    public static final ResponseEntity OVERBESTNUM = new ResponseEntity("502" ,"就诊人数量最大为5");
    public static final ResponseEntity INVALIDTOKEN = new ResponseEntity("501" ,"invalid token");//令牌失效
    public static final ResponseEntity NOACCESS = new ResponseEntity("502" ,"invalid authrity");//无权限
    public static final ResponseEntity LOGINFAIL = new ResponseEntity("701" ,"wrong account or password login fail");//账号或密码错误登录失败
}